<?php
include_once('lib/User.php');
if (isset($_POST['TenDangNhap']) && isset($_POST['MatKhau'])) {
    $userOb = new User();
    if($userOb->kiemtradangnhap($_POST['TenDangNhap'], $_POST['MatKhau'])){
        header("Location: index.php");
    }
}
?>

<div>
    <form action="" method="post" name="DangNhap">
        <table width="500" border="0" align="center" cellspacing="0">
            <tr>
                <td width="139">&nbsp;</td>
                <td width="347">&nbsp;</td>
            </tr>
            <tr>
                <td align="right">Tên đăng nhập</td>
                <td><input name="TenDangNhap" type="text" id="TenDangNhap" size="40px"></td>
            </tr>
            <tr>
                <td >&nbsp;</td>
                <td >&nbsp;</td>
            </tr>
            <tr>
                <td align="right">Mật khẩu</td>
                <td><input name="MatKhau" type="password" id="MatKhau" size="40"></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="right">&nbsp;</td>
                <td><input name="DN" type="submit" id="DN" value="Đăng Nhập"/>       
                    <input name="Huy" type="reset" id="X" value="Hủy"></td>
            </tr>
        </table>
    </form>
</div>

